<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script>
        (function(e, t) {
            function n(e) {
                var n = i.getBoundingClientRect().width,
                    s = n / a * 100;
                d && (s = Math.min(s, 100)), i.style.fontSize = s + "px", t.layout.rootFontSize = s, p && window.devicePixelRatio > 1 && n < 400 && (l.dpr = 1), i.setAttribute("data-dpr", l.dpr);
                if (e) {
                    var o = f * l.dpr,
                        u = a / 100,
                        c = "body {font-size:" + o + "px !important;}";
                    if (d) {
                        var u = a / 100;
                        c += "body {margin-left:auto !important;margin-right:auto !important;max-width:" + u + "rem;}"
                    }
                    var h = [];
                    for (var v = 10; v <= 40; v++) h.push(".f" + v + "{font-size:" + l.dpr * v + "px !important;}");
                    var m = [c, h.join("")].join("\n");
                    r.write('<style type="text/css">' + m + "</style>")
                }
            }
            var r = e.document,
                i = r.documentElement,
                s = r.querySelector('meta[name="viewport"]'),
                o = r.querySelector('meta[name="layout"]'),
                u = e.devicePixelRatio || 1,
                a = 720,
                f = 12,
                l = t.layout || (t.layout = {}),
                c = e.navigator.userAgent,
                h = /(iPhone|ipod|ipad|ios)/i.test(c),
                p = e.navigator.appVersion.match(/android/ig),
                d = !h && !p,
                v = !1,
                m, g, y;
            o && (y = o.getAttribute("content") || "") && (y.match(/width=(\d+)/i), RegExp.$1 && (a = RegExp.$1), y.match(/font-size=(\d+)/i), RegExp.$1 && (f = RegExp.$1), y.match(/dpr(?:=(\d+))?/i) && (v = RegExp.$1 || 1)), u >= 3 ? u = 3 : u >= 2 ? u = 2 : u > 1 && (u = 1), v && (u = v), g = 1 / u, l.dpr = u;
            if (!s) {
                var b = ["initial", "maximum", "minimum", "user-scalable=no"].join("-scale=" + g + ","),
                    w = '<meta name="viewport" content="width=device-width,' + b + '">';
                r.write(w)
            }
            e.addEventListener("resize", function() {
                clearTimeout(m), m = setTimeout(n, 300)
            }, !1), e.addEventListener("pageshow", function(e) {
                e.persisted && (clearTimeout(m), m = setTimeout(n, 300))
            }, !1), n(!0), t.layout.px2rem = function(e) {
                return e / this.rootFontSize
            }, t.layout.rem2px = function(e) {
                return e * this.rootFontSize
            }, t.layout.fontSize = function(e) {
                return e * this.dpr
            }, t.layout.setupRem = n
        })(window, window.lib || (window.lib = {}))
    </script>
    <style>
        .wrap {
            position: relative;
        }
        
        .box {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: deepskyblue;
        }
        
        .box-top {
            position: absolute;
            top: 1000px;
            left: 50%;
            margin-left: -50px;
        }
    </style>

</head>

<body>
    <div class="box box-top js-box"></div>

    <script src="./zp.js">
    </script>

    <script>
        $.fn.scrollTo = function(options) {
            var defaults = {
                toT: 0,
                durTime: 500,
                delay: 30,
                callback: null
            };
            var opts = $.extend(defaults, options),
                timer = null,
                _this = this,
                curTop = _this.scrollTop(),
                subTop = opts.toT - curTop,
                index = 0,
                dur = Math.round(opts.durTime / opts.delay),
                smoothScroll = function(t) {
                    index++;
                    var per = Math.round(subTop / dur);
                    if (index >= dur) {
                        _this.scrollTop(t);
                        window.clearInterval(timer);
                        if (opts.callback && typeof opts.callback == 'function') {
                            opts.callback();
                        }
                        return;
                    } else {
                        _this.scrollTop(curTop + index * per);
                    }
                };
            timer = window.setInterval(function() {
                smoothScroll(opts.toT);
            }, opts.delay);
            return _this;
        };
        var app = {
            init: function() {
                this.render();
                this.bindEvent();
            },
            render: function() {},
            bindEvent: function() {
                $(document).on("click", ".js-box", function() {
                    // var _this = $(this);
                    console.log(1);
                    $(this).scrollTo({
                        toT: 600
                    })
                })
            }
        }
        app.init();
    </script>
</body>

</html>